package mattkrutsick.android.fitnesstracker;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class HomeScreenActivity extends Activity implements OnClickListener{
    /** Called when the activity is first created. */
	Button create, choose;
	private Button start;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.home);
        
        //Create instances of the 2 buttons on this screen
        create=(Button)findViewById(R.id.btnCreateWorkout);
        choose=(Button)findViewById(R.id.btnChooseWorkout);
        start= (Button)findViewById(R.id.btnChoosetwo);
        
        
       //create listeners for each of the buttons if it is clicked
        create.setOnClickListener(this);
        choose.setOnClickListener(this);     
        start.setOnClickListener(this);
    }

	public void onClick(View arg0) 
	{
		if(create.isPressed()){
			startActivity(new Intent(HomeScreenActivity.this, CreateWorkoutActivity.class));
			//HomeScreenActivity.this.finish();
		}
	    if(choose.isPressed()){
	    	Log.v("Choose is pressed..............", "Moving to Choose Screen");
			startActivity(new Intent(HomeScreenActivity.this, ChooseWorkoutActivity.class));
		   // HomeScreenActivity.this.finish();
	}   
	    if(start.isPressed()){
	    	startActivity(new Intent(HomeScreenActivity.this, ChooseWorkoutActivity.class));
	    	// HomeScreenActivity.this.finish();
	    }
	    }
}